<!--chatu-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>留言板</title>

    <script type="text/javascript" src="/css/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="/css/bootstrap.min.js"></script>
    <link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css" />

</head>
<body class="container">

<nav class="navbar navbar-default">

    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
        <a class="navbar-brand" href="/">茶荼</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
        <ul class="nav navbar-nav">
            <li><a href="index.php" >查看留言</a></li>
            <li><a href="pub_comment.php" >我要留言</a></li>
        </ul>
        <form class="navbar-form navbar-left" action="search.php" method="post">
            <div class="form-group">
                <input type="text" class="form-control" placeholder="Search" name="search">
            </div>
            <button type="submit" class="btn btn-default">搜留言</button>
        </form>

        <ul class="nav navbar-nav navbar-right">
            <?php if(isset($_SESSION["user"]))
            {
            ?>

            <li><a href="user.php" ><?php echo $_SESSION["user"];?></a></li>
            <li><a href="logout.php" >退出</a></li>

            <?php }else{?>

            <li><a href="register.php" >注册</a></li>
            <li><a href="login.php" >登录</a></li>
            <li><a href="./admin/admin.php">管理员登录</a></li>
            <?php }?>
        </ul>

    </div><!-- /.navbar-collapse -->
    </div>

</nav>


<div class="page-header">
    <h2>所有留言</h2>
</div>

<div class="row">
    <div class="col-md-0">
    </div>
    <div class="col-md-12">
        <table class="table table-striped">
            <tr>
                <td class="col-md-2"><strong>用户</strong></td>
                <td class="col-md-10"><strong>留言内容</strong></td>
            </tr>


            <?php
                foreach ($commentData as $key => $value) {
            ?>

            <tr>
                <td><?php echo $value["username"];?></td>
                <td><?php echo $value["text"];?></td>
            </tr>


            <?php
                }
            ?>


        </table>



    </div>


    <div class="col-md-0">
    </div>

</div>


<hr/>
<div  class="text-center" >茶阁</div>
<br/>
<br/>
<br/>



</body>
</html>